Add new Rust-based tests
authorColin Walters <walters@verbum.org>
Sat, 28 Mar 2020 14:04:31 +0000 (14:04 +0000)
committerColin Walters <walters@verbum.org>
Wed, 27 May 2020 21:59:23 +0000 (21:59 +0000)
commit1f637bf34103746ab07f359d5488224134a16a08
tree635ac176b75d8086cb6615d4b63a28fdff2d22c0
parent854099802f3367b6fa8b405fe50c5988813e8b4d
Add new Rust-based tests

There's a lot going on here.  First, this is intended to run
nicely as part of the new [cosa/kola ext-tests](https://github.com/coreos/coreos-assembler/pull/1252).

With Rust we can get one big static binary that we can upload,
and include a webserver as part of the binary.  This way we don't
need to do the hack of running a container with Python or whatever.

Now, what's even better about Rust for this is that it has macros,
and specifically we are using [commandspec](https://github.com/tcr/commandspec/)
which allows us to "inline" shell script.  I think the macros
could be even better, but this shows how we can intermix
pure Rust code along with using shell safely enough.

We're using my fork of commandspec because the upstream hasn't
merged [a few PRs](https://github.com/tcr/commandspec/pulls?q=is%3Apr+author%3Acgwalters+).

This model is intended to replace *both* some of our
`make check` tests as well.

Oh, and this takes the obvious step of using the Rust OSTree bindings
as part of our tests.  Currently the "commandspec tests" and "API tests"
are separate, but nothing stops us from intermixing them if we wanted.

I haven't yet tried to write destructive tests with this but
I think it will go well.
13 files changed:
.cci.jenkinsfile
tests/basic-test.sh
tests/inst/.gitignore [new file with mode: 0644]
tests/inst/Cargo.toml [new file with mode: 0644]
tests/inst/itest-macro/Cargo.toml [new file with mode: 0644]
tests/inst/itest-macro/src/itest-macro.rs [new file with mode: 0644]
tests/inst/src/insttest.rs [new file with mode: 0644]
tests/inst/src/repobin.rs [new file with mode: 0644]
tests/inst/src/sysroot.rs [new file with mode: 0644]
tests/inst/src/test.rs [new file with mode: 0644]
tests/kola/nondestructive/.gitignore [new file with mode: 0644]
tests/kolainst/Makefile
tests/runkola [new file with mode: 0755]